package top.kaoshanji.p2ch10a;

/**
 * 代码清单-p2ch10a-322页a：包含复制构造方法的Java类的示例
 * author kaoshanji
 * ^_^
 * create time 2025/2/2 20:26
 */
public class User {

    private String name;
    private String email;

    public User(String name, String email) {
        this.name = name;
        this.email = email;
    }

    public String getName() {
        return name;
    }

    public String getEmail() {
        return email;
    }

    // 一个复制构造方法
    public User(User user) {
        this.name = user.getName();
        this.email = user.getEmail();
    }

}
